using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Organization;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tbTruck"), Serializable]
    public class Truck : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private Company onCompany;
        private string carOwer;
        private string carOwerIdCard;
        private string brand;
        private string color;
        private string ano;
        private string carNumber;
        private string serialNo;
        private string serialMoto;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", 
            Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [BelongsTo("companyGuid")]
        public Company OnCompany
        {
            get { return onCompany; }
            set { onCompany = value; }
        }

        [Property]
        public string CarOwer
        {
            get { return carOwer; }
            set { carOwer = value; }
        }

        [Property]
        public string CarOwerIdCard
        {
            get { return carOwerIdCard; }
            set { carOwerIdCard = value; }
        }

        [Property]
        public string Brand
        {
            get { return brand; }
            set { brand = value; }
        }

        [Property]
        public string Color
        {
            get { return color; }
            set { color = value; }
        }

        [Property]
        public string Ano
        {
            get { return ano; }
            set { ano = value; }
        }

        [Property]
        public string CarNumber
        {
            get { return carNumber; }
            set { carNumber = value; }
        }

        [Property]
        public string SerialNo
        {
            get { return serialNo; }
            set { serialNo = value; }
        }

        [Property]
        public string SerialMoto
        {
            get { return serialMoto; }
            set { serialMoto = value; }
        }
    }
}